package study;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import study.servlet.MyServlet1;

/**
 * Created by lazy on 17-5-17.
 */
@SpringBootApplication
public class AppServelet1 {
    /**
     * 注册Servlet.不需要添加注解：@ServletComponentScan
     * @return
     */
    @Bean
    public ServletRegistrationBean MyServlet1(){
        return new ServletRegistrationBean(new MyServlet1(),"/myServlet/*");
    }

    public static void main(String[] args) {
        SpringApplication.run(AppServelet1.class, args);
    }
}
